import sys

import controller
from head import collect_head
from master import collect_master
from slave import collect_slave

line = sys.argv[1:]
print(line)
if line[0] == "help":
    pass
elif line[0] == "run_slave":
    collect_slave.run_slave()
elif line[0] == "run_head":
    collect_head.run_head()
elif line[0] == "run_master":
    collect_master.run_master()
elif line[0] == "add_slave":
    controller.add_slave(line[1:])
elif line[0] == "add_head":
    controller.add_head_up(line[1:])
elif line[0] == "add_master":
    controller.add_master(line[1:])
elif line[0] == "stop":
    controller.stop()
elif line[0] == "stop_one":
    controller.stop_one(line[1])
elif line[0] == "get_up":
    print(controller.get_up_ip("head"))
    print(controller.get_up_ip("slave"))
else:
    print("no such option")
